hysop.operator.directional.directional module

class hysop.operator.directional.directional.DirectionalOperatorBase(splitting_dim, splitting_direction, dt_coeff, **kwds)[source]

Bases: object

Implementation interface for directional operators.

Create a directional operator in a given direction.

Parameters:
  • splitting_direction (int) – Direction of this operator.

  • splitting_dim – The dimension of the splitting.

  • dt_coeff – Coefficient that should be applied on simulation timestep.

splitting_direction

Direction of this operator.

Type:

int

splitting_dim

The dimension of the splitting.

Type:

int

dt_coeff

Coefficient that should be applied on simulation timestep.

Type:

float

get_field_requirements()[source]
class hysop.operator.directional.directional.DirectionalOperatorFrontend(implementation=None, base_kwds=None, **op_kwds)[source]

Bases: DirectionalOperatorGenerator

Frontend facility for directional operators that provide multiple implementations.

Initialize a DirectionalOperatorFrontend.

Parameters:
  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • op_kwds – Keywords arguments that will be passed towards implementation implemention __init__ during a call to _generate. In addition to those arguments, direction and splitting_dim will also be passed.

  • candidate_input_tensors (tuple of fields, optional) – Candidate input tensor fields that should be rebuilt at discretization. ScalarFields are filtered out.

  • candidate_output_tensors (tuple of fields, optional) – Candidate output tensor fields that should be rebuilt at discretization. ScalarFields are filtered out.

implementation

the implementation implementation

Type:

Implementation

classmethod available_implementations()[source]

Return all available implementations.

abstract default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

property generated
abstract implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.

class hysop.operator.directional.directional.DirectionalOperatorGenerator(operator, base_kwds, candidate_input_tensors, candidate_output_tensors, name=None, pretty_name=None, **op_kwds)[source]

Bases: DirectionalOperatorGeneratorI

Simple ComputationalGraphNodeGenerator to generate an operator in multiple directions.

Initialize a DirectionalOperatorGenerator.

Parameters:
  • operator (ComputationalGraphNodeGenerator or ComputationalGraphNode) – operator class to be built in each direction. operator.__init__ should accept all extra keywords arguments op_kwds + ‘direction’ + ‘splitting_dim’ + ‘name’

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • op_kwds – Keywords arguments that will be passed towards operator.__init__ during a call to _generate. In addition to those arguments, direction and splitting_dim will also be passed.

  • candidate_input_tensors (tuple of fields, optional) – Input tensor fields that should be rebuilt at discretization. ScalarFields are filtered out.

  • candidate_output_tensors (tuple of fields, optional) – Output tensor fields that should be rebuilt at discretization. ScalarFields are filtered out.

custom_directional_kwds(i)[source]

Specify custom keyword arguments that will be passed only for direction i.

dump_inputs(fields=None, io_params=None, directions=None, **kwds)[source]

Tell this operator to dump some of its inputs before apply is called. Target folder, file, dump frequency and other io pameters are passed through io_params.

dump_outputs(fields=None, io_params=None, directions=None, **kwds)[source]

Tell this operator to dump some of its outputs after apply is called. Target folder, file, dump frequency and other io pameters are passed through instance io_params of this parameter.

generate(splitting_dim, **extra_kwds)[source]

Generate splitting_dim operators in each direction.

generate_direction(i, dt_coeff)[source]
generate_only_once_per_direction()[source]
class hysop.operator.directional.directional.DirectionalOperatorGeneratorI(**kwds)[source]

Bases: object

generate(splitting_dim, **kwds)[source]
abstract generate_direction(i, dt_coeff)[source]
abstract generate_only_once_per_direction()[source]
get_direction(i, dt_coeff)[source]

Retrieve operator in direction i.

splitting_dimension()[source]

Returns the splitting dimension used to generate this DirectionalOperatorGenerator.